package com.woniu.springbootshiro.mapper;

import com.woniu.springbootshiro.pojo.Permission;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PermissionMapper extends tk.mybatis.mapper.common.Mapper<Permission> {

    @Select("select a.* from sys_permission a,sys_role_permission b where a.id=b.permission_id and b.role_id=#{roleId}")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "parent_id",property = "parentId"),
            @Result(column = "res_name",property = "resName"),
            @Result(column = "res_type",property = "resType"),
            @Result(column = "permission",property = "permission"),
            @Result(column = "url",property = "url")
    })
    List<Permission> selectPermissionListByRoleId(@Param("roleId") Long roleId);
}
